<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>首页 - 跨境电商借卖平台</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/bootstrap-4.6.2-dist/css/bootstrap.css">
    <style type="text/css">
        body {
            font-family: "微软雅黑", sans-serif;
            background-color: #f8f9fa;
            margin: 0;
            padding: 20px;
        }
        .welcome-container {
            background-color: white;
            border-radius: 8px;
            padding: 30px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
            justify-content: center; /* 垂直居中 */
            align-items: center; /* 水平居中 */
        }

        h1 {
            color: #343a40;
            font-size: 36px;
            margin-bottom: 20px;
        }

    </style>
</head>
<body>
<div class="welcome-container">
    <h1>欢迎, ${sessionScope.user.username} (${sessionScope.user.role == 'GVO' ? '系统管理员' : sessionScope.user.role == 'MVO' ? '品牌商' : sessionScope.user.role == 'BVO' ? '借卖方' : '未知角色'})
    <span style="margin-left: 10px;"> <span id="current-time"></span></span>
    </h1>
</div>

<script src="${pageContext.request.contextPath}/static/js/jquery-3.6.0.min.js"></script>
<script src="${pageContext.request.contextPath}/static/bootstrap-4.6.2-dist/js/bootstrap.js"></script>
<script>
    function updateTime() {
        var now = new Date();
        var year = now.getFullYear();
        var month = (now.getMonth() + 1).toString().padStart(2, '0'); // 月份从0开始，需要加1
        var day = now.getDate().toString().padStart(2, '0');
        var hours = now.getHours().toString().padStart(2, '0');
        var minutes = now.getMinutes().toString().padStart(2, '0');
        var seconds = now.getSeconds().toString().padStart(2, '0');
        var timeString = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds;
        document.getElementById('current-time').textContent = timeString;
    }
    setInterval(updateTime, 1000);
    updateTime();
</script>
</body>
</html>
